package elmar.datastructure.tree;

import java.util.ArrayList;
import java.util.List;

import elmar.datastructure.MarkableElement;

public class Node<T> implements INode<T> {
	private List<INode<T>> children = new ArrayList<INode<T>>(3);
	private T m_data;
	
	public T getData() {
		return m_data;
	}

	public void setData(T m_data) {
		this.m_data = m_data;
	}
	
	
	public Node(T _data) {
		this.m_data = _data;
	}

	public List<INode<T>> getChildren() {
		return children;
	}

	public void addChild(INode<T> _child) {
		children.add(_child);
	}



	// make it makable
	private MarkableElement marker = new MarkableElement();

	public void clearMark() {
		marker.clearMark();
	}

	public Object getMark(String _sKey) {
		return marker.getMark(_sKey);
	}

	public void mark(String _sKey, Object _data) {
		marker.mark(_sKey, _data);
	}
	
	@Override
	public String toString() {
		return m_data.toString();
	}
}
